#ifndef __MovableObject_H__
#define __MovableObject_H__

#include "d3dheaders.h"
#include "defines.h"
#include "video/AxisAlignedBox.h"
#include <string>


namespace KEngine
{

class SceneNode;
class Camera;
class RaySceneQuery;
class RenderQueue;
class MovableObject
{
public:
	MovableObject();
	virtual ~MovableObject();

	virtual void	update();
	virtual void	render(Camera* camera, TimeValue t);

	virtual void	setName(const std::string& name);
	virtual const	std::string& getName();
	virtual void	setAttached(SceneNode* parent);
	virtual bool	isAttached();

	virtual const	AxisAlignedBox& getWorldBoundingBox(bool derive = false);
	virtual const	AxisAlignedBox& getBoundingBox();

	virtual SceneNode* getParentNode();
	virtual void	getParentNodeTransform(D3DXMATRIX& mat);

	virtual void	setVisible(bool visible);
	virtual bool	isVisible() const;

	virtual void	setRenderQueueGroup(unsigned int queueID);
	virtual unsigned int getRenderQueueGroup() const;

	virtual void	_updateRenderQueue(RenderQueue* queue, Camera* cam) = 0;

	virtual void	intersects(RaySceneQuery& raySceneQuery);

protected:
	SceneNode*			mParentNode;
	std::string			mName;

	AxisAlignedBox		mWorldAABB;
	bool				mVisible;

	unsigned int		mRenderQueueID;
};

}

#endif 